package com.hznu.stmanage.serviceImpl;

import com.hznu.stmanage.dao.TutorInfoMapper;
import com.hznu.stmanage.entity.TutorInfo;
import com.hznu.stmanage.service.BaseService;
import com.hznu.stmanage.service.TutorInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by J_Vino on 16/3/6.
 */
@Transactional(rollbackFor = Exception.class)
@Service
public class TutorInfoServiceImpl extends BaseService implements TutorInfoService {

    TutorInfoMapper tutorInfoMapper = null;
    public void setMapper()
    {
        if(tutorInfoMapper==null)
            tutorInfoMapper = getTutorInfoMapper();//1.获取相关mapper
    }
    public int deleteByPrimaryKey(Long id) {
        setMapper();
        return tutorInfoMapper.deleteByPrimaryKey(id);
    }

    public int insert(TutorInfo record) {
        setMapper();
        return tutorInfoMapper.insert(record);
    }

    public int insertSelective(TutorInfo record) {
        setMapper();
        return tutorInfoMapper.insertSelective(record);
    }

    public TutorInfo selectByPrimaryKey(Long id) {
        setMapper();
        return tutorInfoMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(TutorInfo record) {
        setMapper();
        return tutorInfoMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(TutorInfo record) {
        setMapper();
        return tutorInfoMapper.updateByPrimaryKey(record);
    }
}
